package com.hsc.www.amqp.config;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.listener.api.RabbitListenerErrorHandler;
import org.springframework.amqp.rabbit.support.ListenerExecutionFailedException;
import org.springframework.stereotype.Component;

@Component
public class MyRabbitListenerErrorHandler implements RabbitListenerErrorHandler {


    /**
     * Handle the error. If an exception is not thrown, the return value is returned to
     * the sender using normal {@code replyTo/@SendTo} semantics.
     */
    @Override
    public Object handleError(Message amqpMessage, org.springframework.messaging.Message<?> message, ListenerExecutionFailedException exception) throws Exception {


        Object  r=      message.getPayload();


       System.out.println("handleError 调用");
       
        return "handleError 调用";
    }
}
